<?php
TImport('location');

if($html->getContent('type')=='inquiry')
{
    $tourname       = $html->getContent('cName');    
    //$linktour   = GetLinkTourById($tour['iId'],$tour['cUrlString']);
    
    $html->setContent('cMetaTitle',$html->getContent('cMetaTitle').' - '.$tour['cName'].' - '.$tour['cDays']);
    $html->setContent('cIntro',str_replace('{TOURNAME}','<a href="'.$linktour.'">'.$tour['cName'].' - '.$tour['cDays'].'</a>',$html->getContent('cIntro')));
    
    
    
    ImportClass('country');
    $country    = new Country;
}
else if($html->getContent('type')=='tour')
{
    $listPhotos     = ListPhotosTour($html->getId());
    $othertours     = ListOtherTour($html->getContent('iParentId'),$html->getContent('iLocationId'), $html->getId());
    $image          = $html->getContent('cImage');
    $linksendinquiry= GetUrlTourById($html->getId(),true);
    if(!empty($image) && count($listPhotos)==0)
    {
        $image      = array(array('cImage'=>$image,'cName'=>$html->getContent('cName')));
        $listPhotos = array_merge($image,$listPhotos);
    }
}
else
{
    if($html->countUrl>1)
    {
        $typeid = $html->getContent('iId');
    }
    $allTour    = ListAllTour();
    if($ajax==true)
    {        
        echo showSplitPage();
        echo $allTour;
        echo showSplitPage();
        exit;
    }
    
    $listlocation   = ListAllLocation();
    $listtourtype   = BuildTourtype();
}
?>